<?php
namespace app\api\controller\v1;

header("Content-type:text/html;charset=utf-8");
use app\common\lib\exception\ApiException;
use app\api\model\Student as M;

/**
 * Created by PhpStorm.
 * User: 1
 * Date: 2018/3/19
 * Time: 14:31
 */
class Student extends Common
{

    /**
     * 查询是否有每月奖励学币
     *@param receive_id int 用户id 必传
     * @author 巫玉梅 <1120504614@qq.com>
     * @return void
     */
    public function check_month_salary(){
        $student = (new M())->check_month_salary();
        return $student;
    }

    /**
     * @领取每月奖励学币
     * @param receive_id int 用户id 必传
     * @author 巫玉梅 <1120504614@qq.com>
     * @return ApiException|array|string|\think\response\Json
     */
    public function month_salary(){
        $student = (new M())->getMonthCoin();
        return $student;
    }

    /** student_coin student_payment student_bonus
     * @ 回显coin tuition student_bonus 学币 学费 推荐奖金
     * @param id int 学生用户id 必传
     * @author 巫玉梅 <1120504614@qq.com>
     * @return ApiException|array|string|\think\response\Json
     */
    public function read(){
        $student = (new M())->read();
        return $student;
    }

    /**
     * @学生添加关注的课程
     * @author 巫玉梅 <1120504614@qq.com>
     * @return ApiException|array|string|\think\response\Json
     */
    public function add_collect_lesson(){
        $student = (new M())->addFollowLesson();
        return $student;
    }
    /**
     * @学生添加关注的课程
     * @author 巫玉梅 <1120504614@qq.com>
     * @return ApiException|array|string|\think\response\Json
     */
    public function cancel_collect_lesson(){
        $student = (new M())->cancelFollowLesson();
        return $student;
    }

    /**
     * @查询关注课程信息
     * @author 巫玉梅 <1120504614@qq.com>
     * @return ApiException|array|string|\think\response\Json
     */
    public function see_collect_lessons(){
        $student = (new M())->seeAllCollectLesson();
        return $student;
    }

    /**
     *  @ 学生奖金转入学费
     * @author 巫玉梅 <1120504614@qq.com>
     * @return ApiException|array|string|\think\response\Json
     */
    public function rec_bonus_to_tuition(){
        $student = (new M())->getTuitionByBonus();
        return $student;
    }

    /**
     * 学费提现
     * @param int user_id 用户id *必传
     * @param int bank_account_id 银行账户id *必传
     * @param float total_amount 提现金额 *必传
     * @author 王柯 <wangke.email@foxmail.com>
     * @return array|string|\think\response\Json
     */
    public function studentTuitionWithdrawals(){
        $m = new M();
        return $m->tuitionWithdrawals();
    }
}